import itertools as its
#迭代器
words='124567890'
#生成密码本的位数，五位数，repeat=5
r=its.product(words,repeat=2)
#保存在文件中，追加
dic=open('E:\桌面\password.txt',"a")
#i是元组
for i in r:
    dic.write("".join(i))
    dic.write("".join("\n"))
    print(i)
dic.close()
print('密码已生成')